{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}


{% block page_content %}



    {% for report in pagination.items %}
    <div class="post-preview">


        <a rel="tag" class="post-tag">{{_('Employee')}}:{{ report.author.username }}</a>
        <a rel="tag" class="post-tag">{{_('Department')}}:{{ report.department.name }}</a>
        <a rel="tag" class="post-tag">{{_('Week Count')}}:{{ report.week_count }}</a>
        <a rel="tag" class="post-tag">{{_('Year')}}:{{ report.year }}</a>
		<a rel="tag" class="post-tag">{{_('Start')}}:{{ report.year | get_week_days(report.week_count,0) }}</a>
		<a rel="tag" class="post-tag">{{_('End')}}:{{ report.year | get_week_days(report.week_count,1) }}</a>
        {{report.content|safe}}

        {% if report.is_of_current_week %}
            <a href="{{url_for('report.write')}}" rel="tag" class="post-edit-tag">{{_('Edit')}}</a>
        {% endif %}

        {% if report.is_of_last_week %}
            <a href="{{url_for('report.write_last_week')}}" rel="tag" class="post-edit-tag">{{_('Edit')}}</a>
        {% endif %}

        <div><hr></div>
    </div>
    {% endfor %}

    <ul class="pager">
        {% if pagination.has_prev %}
            <li class="previous"><a href="/my_report/{{pagination.page-1 }}">&larr; Newer </a></li>
        {% else %}
            <li class="previous disabled"><a href="#">&larr; Newer </a></li>
        {% endif %}

        {% if pagination.has_next %}
            <li class="next"><a href="/my_report/{{pagination.page+1}}">Older &rarr;</a></li>
        {% else %}
            <li class="next disabled"><a href="#">Older &rarr;</a></li>
        {% endif %}
    </ul>

{% endblock %}
